package com.lyeducation.entities.Files;

import lombok.Data;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.util.Objects;

@Data
@MappedSuperclass
public class FileEntity extends FilesSuperEntity {

  private static final long serialVersionUID = -9039243589465507252L;

  private String fileFolderId;

  private String mimeType;

  public static long getSerialversionuid() {
    return serialVersionUID;
  }

  public static long getSerialVersionUID() {
    return serialVersionUID;
  }

  @Basic
  @Column(name = "fileFolderId", nullable = false, length = 18)
  public String getFileFolderId() {
    return fileFolderId;
  }

  public void setFileFolderId(String fileFolderId) {
    this.fileFolderId = fileFolderId;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
        return true;
    }
    if (!(o instanceof FileEntity)) {
        return false;
    }
    if (!super.equals(o)) {
        return false;
    }
    FileEntity that = (FileEntity) o;
    return Objects.equals(fileFolderId, that.fileFolderId) &&
            Objects.equals(mimeType, that.mimeType);
  }

  @Override
  public int hashCode() {

    return Objects.hash(super.hashCode(), fileFolderId, mimeType);
  }
}
